package com.dzl.express;

import com.dzl.order.pojo.vo.WelfareOrderExpressVo;
import com.dzl.order.service.WelfareOrderExpressService;
import com.dzl.util.EmptyUtils;
import com.dzl.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 物流信息查询控制层
 * @author ChenLong
 * @date 2021-05-26 11:30:42
 */
@RestController
@RequestMapping("/welfareExpress")
public class WelfareExpressController {

    @Autowired
    private WelfareOrderExpressService service;

    /**
     * 订单物流信息查询
     * @param orderId 订单id
     * @return com.dzl.util.JsonResult
     * @date 2021/5/28 17:19
     * @author ChenLong
     */
    @GetMapping("getOrderExpressInfo")
    public JsonResult<List<WelfareOrderExpressVo>> getOrderExpressInfo(Integer orderId) {
        if (EmptyUtils.isEmpty(orderId)) {
            return JsonResult.paramErrWithMsg("参数错误");
        }
        return JsonResult.success(service.getOrderExpressInfo(orderId));
    }
}
